package cn.cmeizu.spring6.validator.three;

import cn.cmeizu.spring6.validator.four.CannotBlank;
import jakarta.validation.constraints.*;

/**
 * @author cmeizu
 * @date 2023/2/19 19:11
 */
public class User {
  @NotNull
  private String name;

  @Min(0)
  @Max(150)
  private int age;

  @Pattern(regexp = "^1(3|4|5|7|8)\\d{9}$", message = "手机号码格式错误")
  @NotBlank(message = "手机号码不能为空！")
  private String phone;

  public String getMessage() {
    return message;
  }

  public void setMessage(String message) {
    this.message = message;
  }

  @CannotBlank
  private String message;

  public String getName() {
    return name;
  }

  public void setName(String name) {
    this.name = name;
  }

  public int getAge() {
    return age;
  }

  public void setAge(int age) {
    this.age = age;
  }

  public String getPhone() {
    return phone;
  }

  public void setPhone(String phone) {
    this.phone = phone;
  }


  @Override
  public String toString() {
    return "User{" +
        "name='" + name + '\'' +
        ", age=" + age +
        ", phone='" + phone + '\'' +
        '}';
  }
}
